package org.sny7.openOfflineList.bean;

import java.util.ArrayList;
import java.util.List;

import org.dom4j.Node;
import org.sny7.openOfflineList.gui.GameList;

public class Games {
	
	private static List<Game> gameList = new ArrayList<Game>();
	
	private Games() {
		
	}
	
	public static void generate(List<Node> nodeList) {
		gameList.clear();
		GameList.clear();
		for (Node node : nodeList) {
			Game game = new Game();
			game.setLocation(node.selectSingleNode("location").getText());
			game.setTitle(node.selectSingleNode("title").getText());
			game.setReleaseNumber(node.selectSingleNode("releaseNumber").getText());
			game.setComment(node.selectSingleNode("comment").getText());
			gameList.add(game);
		}
		GameList.addAll(gameList);
	}

}
